<!DOCTYPE html>
<html lang="zh-cmn-Hans" xmlns:th="http://www.thymeleaf.org" th:with="title='自助办税情况汇总'">
<head th:replace="common/head_query :: common_header_query(~{::link},~{::script})">
    <script type="text/javascript"
            th:src="@{${#servletContext.getAttribute('web.static.url')}+'/echarts2/dist/echarts.js'}"></script>
</head>
<body style="overflow: hidden;">

<div style="height: 500px;width: 100%;" id="queryChars">

</div>

<input th:id="xAxis" th:value="${xAxis}" type="hidden"/>
<input th:id="invoke" th:value="${invoke}" type="hidden"/>
</body>
<script type="text/javascript">
    $("#queryChars").height($(window).height());
    $(function () {
        require.config({
            paths: {
                echarts: echarts2_dist_url
            }
        });
        require(
            [
                'echarts',
                'echarts/chart/line',
                'echarts/chart/bar'
            ],
            function (ec) {
                var myChart = ec.init(document.getElementById('queryChars'));
                window.onresize = function () {
                    if (myChart) {
                        myChart.resize();
                    }
                };
                var option =
                    {
                        tooltip: {'trigger': 'axis'},
                        toolbox: {
                            'show': false
                        },
                        calculable: true,
                        xAxis: [{
                            type: 'category',
                            data: $.parseJSON($('#xAxis').val())
                        }],
                        yAxis: [
                            {
                                type: 'value',
                                name: '户次'
                            }
                        ],
                        series: [
                            {
                                name: '户次',
                                type: 'bar',
                                barMaxWidth : 30,
                                data: $.parseJSON($('#invoke').val())
                            }
                        ]

                    };
                myChart.setOption(option);
            }
        );
    });
</script>
</html>